using Cysharp.Threading.Tasks;
using IQIGame.Onigao.Game;
using UnityEngine;

namespace IQIGame.Onigao.GamePlay
{
    /// <summary>
    /// 关卡掉落物动画表现类
    /// </summary>
    public class LevelDropItemPlay : DropItemPlay
    {
        protected LevelPlayRegionController regionCtrl => LevelPlayModule.Instance.levelPlay.regionCtrl;
        public override Transform dropHolder => regionCtrl.areaEffectCtrl.effectRoot;
        public override TViewEntity playerAvatarEntity => regionCtrl.entityCtrl.GetMainCharacter();

        public override UniTask<Entity> ShowDrop(int itemCid, bool isLightBeam, Vector3 position)
        {
            return regionCtrl.effectCtrl.ShowFreeEffect(dropHolder, GameScenePlayUtil.GetDropEffectPathByItem(itemCid, isLightBeam), position);
        }

        public override void HideDrop(Entity entity)
        {
            regionCtrl.effectCtrl.HideFreeEffect(entity);
        }
    }
}
